//
//  YCGoodsDetailTableViewCell.m
//  lianganyuchu
//
//  Created by iMac on 17/3/2.
//  Copyright © 2017年 杭州桑缇电子商务有限公司. All rights reserved.
//

#import "YCGoodsDetailTableViewCell.h"

@implementation YCGoodsDetailTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.label1 setFont:[UIFont LightFontOfSize:16]];
    [self.labelName setFont:[UIFont LightFontOfSize:16]];
    [self.labDesc setFont:[UIFont LightFontOfSize:15]];
    [self.labPrice setFont:[UIFont LightFontOfSize:15]];
    
    [self.label1 setTextColor:TEXT_DEEP];
    [self.labelName setTextColor:TEXT_DEEP];
    [self.labDesc setTextColor:TEXT_MIDDLE];
    [self.labPrice setTextColor:TEXT_MIDDLE];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)bindWith:(ItemTable *)item
{
    if (_isDesc) {
        [self.labelName setText:@"食材说明"];
        self.lineView.hidden=YES;
        self.label1.hidden=YES;
        self.labPrice.hidden=YES;
        
        CGFloat height=getTextSize(item.component, kMainScreen_Width-80, [UIFont LightFontOfSize:15]).height+130-36;
        [self.backView addShadowWith:CGSizeMake(kMainScreen_Width-2*kDistance, height)];
        
        [self.labDesc setText:item.component];
    }else{
        self.lineView.hidden=NO;
        self.label1.hidden=NO;
        self.labPrice.hidden=NO;
        
        CGFloat height=getTextSize(item.desc, kMainScreen_Width-80, [UIFont LightFontOfSize:15]).height+170-36;
        [self.backView addShadowWith:CGSizeMake(kMainScreen_Width-2*kDistance, height)];
        
        [self.labelName setText:item.name];
        [self.labDesc setText:item.desc];
        [self.labPrice setText:[NSString stringWithFormat:@"￥%@",item.price]];
    }
    
}


@end
